package com.wontube.client.modle.vo;

import java.io.Serializable;

/**
 * @author yuechao
 * 
 */
public class PagenateSupport implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 每页允许的最大数量
	 */
	public static final int maxPageSize = 500;
	
	/**
	 * 总数量
	 */
	private int totalCount = 0;
	
	/**
	 * 分页参数信息
	 * 
	 */
	private PagenateInfo pagenateInfo = new PagenateInfo();

	/**
	 * 获取总数量
	 * 
	 * @return
	 */
	public int getTotalCount() {
		return this.totalCount;
	}
	
	/**
	 * 设置总数量
	 * 
	 * @param value
	 */
	public void setTotalCount(int value) {
		this.totalCount = value;
	}
	
	/**
	 * 获取分页参数信息
	 * 
	 * @return
	 */
	public PagenateInfo getPagenateInfo() {
		return this.pagenateInfo;
	}

	/**
	 * 设置分页参数信息
	 * 
	 * @param value
	 */
	public void setPagenateInfo(PagenateInfo value) {
		this.pagenateInfo = value;
	}
	
	public int getPageSize(){
		return this.pagenateInfo.getPageSize();
	}
	
	public int getPageNo(){
		return this.pagenateInfo.getPageNo();
	}
	
	public int getPageCount(){
		return (int)Math.ceil(this.totalCount * 1d / getPageSize());
	}
}
